package com.general.framework.core.enums;

import com.general.framework.core.lang.Strings;

import java.util.Objects;

/**
 * 客户端类型
 */
public enum  ClientTypeEnum {

    open_api("open-api","开放平台"),
    web("web","门户网站"),
    h5("h5","h5"),
    app_android("app-android","安卓端"),
    app_ios("app-ios","iOS端"),
    wx_official_account("wx-official-account","微信公众号"),
    wx_lite("wx-lite","微信小程序"),
    ali_lite("ali-lite","阿里小程序");

    ClientTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    private String type;

    private String name;

    public String getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public static String getDesc(Integer type) {
        for (ClientTypeEnum thisEnum : ClientTypeEnum.values()) {
            if (Objects.equals(thisEnum.type, type)) {
                return thisEnum.name;
            }
        }
        return Strings.EMPTY;
    }
}
